package com.gjy.liteflow.flow;

import com.yomahub.liteflow.core.NodeSwitchComponent;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;

import java.util.concurrent.ThreadLocalRandom;

/**
 * @author 宫静雨
 * @version 1.0
 * @since 2023-07-29 10:12:07
 */
@Component(value = "d")
@Slf4j
public class Dcmp extends NodeSwitchComponent {

    @Override
    public String processSwitch() throws Exception {
        int i = ThreadLocalRandom.current().nextInt(3);
        log.info("process d {}", i);
        if (i == 0) {
            return "tag:cat";
        } else {
            return "tag:dog";
        }
    }
}
